package com.yrihr.wisdom.controller;

import com.yrihr.wisdom.common.ResponseBody;
import com.yrihr.wisdom.common.ResponseCode;
import com.yrihr.wisdom.entity.User;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName : LoginController
 * @Description : 登陆controller
 * @Author : wind
 * @Date: 2020-11-24 18:20
 * @Version 1.0
 */
@RestController
public class LoginController {

    @RequestMapping(value = "/api/admin/login", method = RequestMethod.POST)
    public ResponseBody login(@RequestBody User user) {
        if (user.getUsername().equals("admin") && user.getPassword().equals("123456")) {
            return ResponseBody.success(ResponseCode.USER_LOGIN_SUCCESS,null);
        } else {
            return ResponseBody.success(ResponseCode.USER_LOGIN_ERROR,null);
        }
    }
}
